Fix a panic when building with build scripts
authorAlex Crichton <alex@alexcrichton.com>
Tue, 11 Nov 2014 19:59:31 +0000 (11:59 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 13 Nov 2014 00:25:04 +0000 (16:25 -0800)
commit673c30de64bf118af7aa51aab219ba7fc9cdc26e
treed4dc0e6f79ce0e18dcfdea8d17eacf68319d2b8d
parente6ec71a85249984c4ed3ed409b770f0639c1de1c
Fix a panic when building with build scripts

A package can be required to be built for both the host and target architectures
in some cases. For example a crate could be a normal dependency and a build
dependency. Cargo specially handles this case with respect to the build script
to ensure that the build script is run once per output platform.

Cargo also has logic, however, to run the build script only once when the target
and host platforms are the same. In this case Cargo previously wasn't filling in
the local build script output cache for both the host and target platforms, just
the target platform. This commit remedies this situation by ensuring that cargo
populates both the host and target locations in the cache.

Closes #838
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/mod.rs
tests/test_cargo_compile_custom_build.rs